package cn.liontalk.proxydemo;

public class AServiceProxy implements IService {


    private  AService aService ;

    public AServiceProxy(AService aService){
        this.aService = aService;
    }

    @Override
    public void m1() {

        long starTime = System.nanoTime();
        this.aService.m1();
        long endTime = System.nanoTime();
        System.out.println(this.aService.getClass() + ".m1()方法耗时(纳秒):" + (endTime - starTime));
    }

    @Override
    public void m2() {
        long starTime = System.nanoTime();
        this.aService.m1();
        long endTime = System.nanoTime();
        System.out.println(this.aService.getClass() + ".m2()方法耗时(纳秒):" + (endTime - starTime));
    }

    @Override
    public void m3() {
        long starTime = System.nanoTime();
        this.aService.m1();
        long endTime = System.nanoTime();
        System.out.println(this.aService.getClass() + ".m3()方法耗时(纳秒):" + (endTime - starTime));
    }
}
